#include "eventfilter.h"
#include <QEvent>
#include <QApplication>

EventFilter::EventFilter(QObject *parent) :
    QObject(parent)
{
    qApp->installEventFilter(this);
}

bool EventFilter::eventFilter(QObject *o, QEvent *e)
{
    if(e->type()==QEvent::Close) {
        e->ignore();
        emit applicationClose();
        return true;
    }

    return QObject::eventFilter(o, e);
}
